package com.mo.admin.api.auth.controller;

import com.mo.admin.api.auth.service.AuthService;
import com.mo.admin.api.user.domain.User;
import com.mo.admin.common.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AuthController {
    @Resource
    private AuthService authService;

    @PostMapping("login")
    public Result login(@RequestBody User user) {
        return authService.login(user);
    }

    @PostMapping("logout")
    public Result logout() {
        return authService.logout();
    }
}